<script setup>
defineProps(['username', 'avator'])
</script>

<script>
export default {
  name: 'UserInformation',
}
</script>

<template>
  <div>
    <div class="user-container">
      <div class="user-info">
        <div class="user-info-main">
          <div class="user-avator">
            <van-image round width="35%" height="135%" :src="avator" />
            <div class="user-name">
              {{ username }}
            </div>
          </div>
          <slot name="option" />
        </div>
      </div>
      <div class="user-lines"></div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.user-container {
  margin: 0 auto;
}

.user-info {
  margin: 0 auto;
  width: 85%;
  height: 6rem;
  border-radius: 7px;
  box-shadow: #c6ecda 12px 2px 23px 5px;
  background-color: #fff;
}

.user-lines {
  margin: 0 auto;
  width: 78%;
  background-color: #07ceb4;
  height: 0.3rem;
  border-radius: 2px 2px 10px 10px;
}

/*用户信息主体*/
.user-info-main {
  width: 85%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-name {
  width: 80%;
  margin-left: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*用户头像*/
.user-avator {
  display: flex;
  align-items: center;
  width: 12rem;
  height: 2.5rem;
}
</style>
